<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<link rel="stylesheet" href="../static/css/css.css">
<script src="../static/js/jquery-1.8.3.js"></script>
<script>
    function createGroupOrder(gsmGroupId) {
        $.ajax({
            type:"get",
            url:"/createGroupOrder",
            data:{"gsmGroupId":gsmGroupId},
            dataType:"json",
            success:function (res) {
                if (res) {
                    location.href = "http://order.snow-mall.com/toOrder?osmId="+res.osmId;
                }
            }
        })
    }
</script>
<body>
<ul>
    <li>
        <a th:if="${session.user != null}">欢迎, [[${session.user.usmName}]]</a>
        <a th:if="${session.user == null}" href="http://auth.snow-mall.com">你好，请登录</a>
    </li>
    <li>
        <a th:if="${session.user == null}" href="http://auth.snow-mall.com/register.html" class="li_2">免费注册</a>
    </li>
    <li>
        <a th:if="${session.user != null}" href="http://auth.snow-mall.com/loguot.html" class="li_2">立即退出</a>
    </li>
</ul>
<table>
    <tr>
        <td>活动名称</td>
        <td>商品名称</td>
        <td>商品展示</td>
        <td>商品原价</td>
        <td>拼团价格</td>
        <td>成团数量</td>
        <td>限购数量</td>
        <td>活动时间</td>
        <td>活动描述</td>
        <td>操作</td>
    </tr>
    <tr th:each="li:${list.list}">
        <td th:text="${li.gsmGroupName}"></td>
        <td th:text="${li.psmName}"></td>
        <td>
            <img th:src="${li.psmImg}" alt="" style="width: 100px ; height: 100px">
        </td>
        <td th:text="${li.psmPrice}"></td>
        <td th:text="${li.gsmGroupPrice}"></td>
        <td th:text="${li.gsmGroupCount}"></td>
        <td th:text="${li.gsmGroupLimitCount}"></td>
        <td th:text="${#dates.format(li.gsmGroupStartTime,'yyyy-MM-dd HH:mm:ss')}+ '     至     ' + ${#dates.format(li.gsmGroupEndTime,'yyyy-MM-dd HH:mm:ss')}"></td>
        <td th:text="${li.gsmGroupShareDescription}"></td>
        <td>
            <input type="button" value="开启拼团" th:onclick="|createGroupOrder(${li.gsmGroupId})|">
        </td>
    </tr>
</table>
</body>
</html>
